//
//  HeaderCollectionReusableView.m
//  23-HomeWorkQQMusic
//
//  Created by dllo on 16/8/13.
//  Copyright © 2016年 LST. All rights reserved.
//

#import "HeaderCollectionReusableView.h"
#import "MvList.h"
#import "List.h"
#import "UIImageView+WebCache.h"
@implementation HeaderCollectionReusableView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self creatSubView:self.bounds];
    }
    return self;
}
- (void)creatSubView:(CGRect)sender {
    _headerImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 30, self.bounds.size.width, self.bounds.size.height * 0.7)];
    [self addSubview:_headerImage];
    _labelHeader = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, 30)];
    _labelHeader.textAlignment = 1;
    _labelHeader.font = [UIFont systemFontOfSize:25];
    [self addSubview:_labelHeader];
    _labelFoot = [[UILabel alloc] initWithFrame:CGRectMake(0, self.bounds.size.height * 0.7 + 30, self.bounds.size.width, self.bounds.size.height - self.bounds.size.height * 0.7 - 30)];
    [self addSubview:_labelFoot];
}

- (void)setList:(List *)list {
    _list = list;
    _labelHeader.text = list.name;
    _labelFoot.text = [NSString stringWithFormat:@"%@-%@", list.mvlist[0].mvtitle, list.mvlist[0].singername];
    [_headerImage sd_setImageWithURL:[NSURL URLWithString:list.mvlist[0].picurl] placeholderImage:nil];
}



@end
